package 建造者模式;

public class XmlBuilder extends Builder {

    private Product product;

    public XmlBuilder() {
        this.product = new Product();
    }

    @Override
    Builder writeHead(String msg) {
        this.getProduct().setFileHead(msg);
        return this;
    }

    @Override
    Builder writeBody(String msg) {
        this.getProduct().setFileBody(msg);
        return this;
    }

    @Override
    Builder writeTail(String msg) {
        this.getProduct().setFileTail(msg);
        return this;
    }

    @Override
    Builder outFile() {
        return this;
    }

    @Override
    Product getProduct() {
        return this.product;
    }

}
